Optional<T>: comments and fixed memory leak