Make it work with newer version of IPython
Merge branch 'new-ipython'