Cleanup cursor code.