Make sure the environment var is read consistently

Based on the Procfile I assume it is expected for the environment var to be set as an OS env var instead of via command line. This was already assumed in the system.get function, but it was not assumed when checking the environment in other places in the code.