Fix IPython 1.1 compatibility