Fixed infinite recursion with class constructors