Fix peek_and_skip for memory provider