Start handling nested classes, and other fixes