Fix removal of ghosts