Fixed environment variable approach

Consider aa38e57d42c251eb1e2df5d9c8793162c30d52c6 a damp squib :P