Solve RenderStates segfault.