Select work dir if not defined.