Fixed fatal error in template driver