Fix some issues reported by shellcheck