Changed block/char-device detection as jeffdoering suggested.