Various changes to Loader and templates