This is more sematically correct, there will never be a negative amount of environment variables. It also fixes up some implicit casting errors.