Added updating of types in the environment on the fly