Would be great if we have a test case to assert that this code is needed. I could not understand why it is needed here and it is not in `global` and `local` classes.