Using the uniform grid triggers an access violation when emitting photons. It may be a general problem, however.