Fixed template type errors.