Freeze environment properly