Fix duplicate loads by legacy code