bug fix and test for time boundary
bunch of issue fixes