Fix multiple OpenGL errors

These changes were required for the GLSL shaders to compile on my AMD R9 270X running the 4.4.12874 drivers on Ubuntu 14.04 LTS. Please review and ensure cross-platform, I don't have an Nvidia linux config to confirm. Unrelated to this commit, all multidraw examples currently hang the AMD driver. I'm investigating now