Fix errors with url transformation and add new tests