Fix bug of using wrong rectangle for occlusion detection.