Fixed range checking on the number of lights.