Allow env variables

as per @3rd-Eden 's patch