Fix indentations, else statement, string formatting in template