Fix issue with branches array - refs BT#8543