Healthcheck problems

Fixes for crash problems found while running tests on about 3000 domains (900-odd from the Healthcheck project, 2000 randomly selected) under .SE.