fix some IPython mocking issues