Check for size > 0 before sorting anything; fixes #10