small tweaks to make loader more robust