Add a few unit tests for python timestamps. Fix bugs with timestamp code.