Cleanup and minor improvements.