Fix bug with change flags