Fix bug in reflection detect