Fixed blank timestamp

Cleaned up all setlocal/endlocals