Fixed possible shader bug.

See http://stackoverflow.com/a/15008409/713961