Added type check for matrix uniforms