Also some minor style cleanups.
Many thanks to jake for doing the initial driver and for helping me in making this work.