Fixed url parser and added tests