Somewhat improved error handling (plus added a few files forgotten
earlier)