Similar to above this could be eliminate by providing a default dir instead of nil.