Fix cursor visibility bug.