Made delete_by_headnode resistant to non-existing headnodes
Made delete_by_headnode resistant to non-existing headnodes

printedheart/micropsi2,printedheart/micropsi2,ianupright/micropsi2,printedheart/micropsi2,ianupright/micropsi2,ianupright/micropsi2