Clean up leaky cursors.