Updated to include a more reliable test for "mkdir"