Fix bug with getting branches