Bug fixes, political time, and minimal DOY values

This implements the code in PR #28, along with my suggested edits.