Template render error: Unexpected tag name "endif"