Fixed a bug in utils.deep_compare() and updated associated tests