Pass env variables to subtask processes
Fix error in path validation logic