Fix shift+enter bug. Also fix a bug where pyerr messages were messing up the next input