Manually cleaned up merged code.