Needed for upcoming ipython update. Input from benoit@, sthen@ and shadchin@. OK sthen@ and shadchin@. Thanks.