Fixed some bugs and added test file for gl_renderer