Make removeObject work properly.