Fixed incorrect implementation of the Extract Module refactoring