Cleaned-up lookup of auto-complete context.