Fixing a bug in branch updates