More robust webgl detection, and fixed a little bug.