Fixed JS sorting error with an empty table.