Fix render runtime exceptions in templates