Fix empty arrays on save

The "$set" in mongodb only updates the fields defined in the operation. 

An array field could not be set to empty as the empty fields were not in the modifier. 

cleanNulls seems to delete the empty array fields so it had to be done after the cleaning wich is not very nice.