Fixing a big bug that keeps the week from ever being anything other than 1.
Assorted cleanup.