Fix getTypeOf method