Fix range check in add/remove, comment clarity