Fixed to lighting stuff, and added assertions to material setParameter to catch badness.