Fix automatic duplicate clearing for palette