Integrated patch from Tobias for windows real-time synchronization.

Is related to #43. Needs further attention.