Are you including A7 templates from "templates\code"? Have you then set the light number in the templates?
If you are not sure how many lights are actually set, just check max_lights in a panel or with a printf command at runtime. If you set it to 8 in the templates, you won't see more than 8 lights, no matter what you set at startup.