remove pointless [] around if tests and make sure we quote properly for -z tests
remove pointless [] around if tests and make sure we quote properly for -z tests

jordemort/e17,jordemort/e17,jordemort/e17