Fix devices

Correct the errors reported by @nickdesaulniers in issue #8.

Nick: does this look right to you?