Fixed environment variable issues