Fix a handful of minor bugs.