Fix crash when trying to remove too much magic. Fix #429.