Added missing includes and std:: qualification for ptrdiff_t.
Added a missing include.