Moved cursor closing into compatibility mode.  THanks to efung.