Various code cleanups.