Small cleanups; re-examined some things thanks to Connor Skennerton.