More fixes for GLSL optimisation