Bugfixes

I've been running Hiawatha with these bugfixes for several years now.  Please incorporate all patches which you see fit.