"flatnested" fix for nested classes defined out of class in global scope