Fix a few scripts according to shellcheck static analysis