Fixing bugs.

After rebase with master, several issues came up.
Specifically, start and end time region got broken.