Fix a bug in Residence compareTo()