Fixed major issue with Intel graphics driver and depth buffer. Other
minor fixes to grid code and viewport setting code.