checking for parentnode in remove, cleaning other remove ops closes #271