Fix some mistakes discovered last night

Mostly typos, or code that didn't get refactored all the way, or missing
table joins, or incomplete comments. C'est la vie.