fixing a few more issues found by the incomparable Shane