A few more bug fixes

Fixed a few more bugs, but there is still one remaining when starting
the server.  Going to have to add that into the regression tests.
Also, I still need to write the regex host matching bits.