Fixed typing error in (length(j)==1)