MADS: Fix restoring upper palette area when dialogs close