Fix period allocation generation bug

Pops up when doing year groupings that involve partial years at the end.