Fix sending cursor to wrong position