Added more tests for http location, fixed a couple of bugs