Added missing else when checking frag nullness in add / replace