fix small bug in remove method

remove, when called with undefined or with and object not in the array, was removing the last item in the array in chrome