Fix env when running as console command