Fixes a bug where toObject() returned the entire prototype structure