Fixed inversion during refactoring