Fix source code format errors and errors in not trimming off milliseconds in timestamp