Fixes some bugs with non valid urls
Merge branch 'master' into staging