bugfix for sorting empty arrays