fixed templates, minor fixes, passing names for external modules