You need to doublequote the variables or the test will fail when they don't exist.