Fixes timestamp issue on 32-bit machines and fixes sleeping bug.