Cleanup code and fix copy/paste mistake.