Fix to wierd problem with cursor being invalid during fitting.