Fixing NPE--cha.lookupClass(T) can return null when called in "cha.lookupClass(T).getDimensionality()" at line 210. I have repaired this by moving the check "IClass klass = cha.lookupClass(T); if (klass == null)...return null" earlier.