some native JS and GLES compatibility fixes