Error checking in branch