Fixes refactoring bug
Merge pull request #945 from kitan1982/bugfix

Fixes refactoring bug