Fix mistakes found by shellcheck

http://www.shellcheck.net/