Fix bug get changes for build

 - Increase unittests coverage for getChangesForBuild (use several codebases)
 - Fix bugs raised by the unitests.