Fixed a bug caused by nil branching_logic