Check for possible IOError
Cleanup code completion mode. Fix #58