Fix a this scope error in the auto detection