fix edgecase of startsWith

closes #373