Fix environment variables & stupid bug in main