Fix bug in devio.py