#3022 several fixes to load metadata