Clean up and fix compile errors.