Ported the class type, and fixed some things.