install: fix template handling to not corrupt lines