Fixes to the diffuse code