New controlmodes (under ifdef), code cleanup.