Fixed PHP-1084: collection->update($query, $document) crashes if $docume...

...nt is an object