Fix bash issues marked by shellcheck
After adding a CI job that runs shellcheck a few issues appeared. These should be simple fixes. We should fix these and then stop allowing the job to fail.
Yes this issues was copied verbatim from #1418 (closed) :)