Update build process, fix templates