Fixes IDs sorting as strings

Some changes to the table model fixed this.