Add feature to force directory to be set, or throw an error.