some fixes to loader