Fixed bug with change flags - fixed #2