Fix conversion of UNIX timestamps in JSON output

Fixes #311