Small fixes

1. IPython error message is fixed;
2. small style issues are fixed (feel free to reject).