Fix bug in compareObjects where keys where in different order.