Tweaked control code.