Check for null element in the branch array, fixes #56