Improve timestamp checks, escape nul bytes in log.