Fixed change bug
Refactoring, bug fixes