Another couple cleanups for the new auto-detection routine.