Small fixes for WebGL

See the two comments at the end of the commit.