Fixed loop on --ipython startup due to a missing import statement.  As an extra precaution, the --ipython option now does sys.exit(1) on error.