More cleanup and minor improvements.