Added support for else statements in templates