Fail if device number can not be resolved to a device.

Signed-off-by: Philipp Wolfer <ph.wolfer@gmail.com>