MADS: Fixes and cleanup for palette loading