added support for relative urls, and fixed a couple of bugs