Improve oredict handling for foreign objects