Fix device sorting when name is null.

Closes #68.