Update error handling and correctly return paths

Update to make it explict that datadirs only ever expects 1 argument

Update the directory passing to correctly trip off environment variables