Fixed wrong new lines in template, and renamed akey and avalue back to key and value