Minor cleanups before I switch to a stateless functional version.