This fixes a regression caused by 54269dc0 (Remove obsolete arena_maybe_purge() call.), as well as providing a general fix. This resolves #665.