Reworked malformed URI fix so that the user always gets a 400.

This is a rework of #216 such that we always return a 400 in a malformed URL, we don't attempt a cleanup.