Fixed shader problems that occured with different hardware.
Includes the fix mentioned in earlier commit...