startIndex bug correction

startIndex must not be modified when building the url
+Tests

Signed-off-by: Emmanuel Mathot <emmanuel.mahot@gmail.com>