Added a new, simpler time correction algorithm which should be more robust.