fixes to run correctly with "set -e" (don't exit on errors which are not errors)