Add missing headers (#include <limits> and #include <memory>).