bugfixes in time measurement