Fixes problem with m_cursors and invalid cursors.