More work on gl_state