fix ArrayObject::replace method.