Improve crab purge, for issue #4101