Fixes mixed usage of float/double for timestamp and improves estimate accuracy to avoid drift. There is no reason to use floats in this code.