Misc clean-ups

Here are some miscellaneous clean-ups from the code review I promised the other day.

-- 
ilmari, aka TokenScandi