Fix typo in substr detection