Fixes trailing slashes bug.

If a URL like '//test' is posted to, it was possible to fuck everything
up by creating an empty database name. Now a string like that will look
like '/test' to Oleg.