Environment variables, other type fixes