Bug fix in lookup_value