Fixed an array offset issue and a typo that broke FREQ=MONTHLY

I found a few issues and created tests/fixes for them.