Fix bug in lifted environment inspection code