Compare device/inodes correctly.

Resolves #640.