Fix indexOf with offset set