BUG: lookup global constants correctly in query/eval