Fixed possible NullPointerException when type.getClassLoader() is null