Better timestamp conversion. fixes #5