Significant improvements, mostly concerning the inaccurate timestamps

I also implemented the pull request @hxe made a while ago, the one that was never implemented.

I hope that this one does not meet the same fate.