Fixed a bunch of issues with ivy in the shader, but not all of them.
Added provisions for debugging in shader.