add assertions that the index in the unsafe version can't be negative