Fix issue causing shader output to be invalid