Miscellaneous commits from a day of bug fixing.