fixes to dynamic loading