Removed bug in compute-lambertian plus other minor changes