Got rid of template_files popping and assert, isn't needed it seems.