Fix cluster calculation for non-LTR text