Fixed some bugs in reflection/refraction

reflection/refraction almost done. need to test some things before
completion.