Fix env map computation