Add assertion on ptr, len constructor