Fix: toObject bug