Fixed rectangle scanning bug.