Improved documentation to describe current behaviour. Added tests.
Simplified code. Removed unneeded variable. Added time some zone based tests.
Removed dead code and simplified code.
Small improvements.
Merge remote-tracking branch 'upstream/master'