improve/harden/fix palette reset on destruction