Track down and fix a problem with the lookingAt optimization.