Bugfix on inherit private magic methods

There should also be a test that checks the newly introduced `ClassGenerator` class specifically.