Fixes a ClassCastException in the AWT GLCanvas