Big merge and cleanup.