Cleaned up scripts using shellcheck.