Handle Malformed URIs Bug

It would be a good idea to add a couple of tests for this one.