Fixing cursorlocation bugs