Fixed template compiler errors: missing typedef's added