Little optimizations

Just a few optimizations that can land independently of the lightmap thing.