Sort the devices by ID

This might fix #60.