Add compatibility with IPython