Fixed typo in grep length check