Fix for cursor placement matching