flushed stdout in getTime and some other small fixes