Switch order of check for directory's existence.