fixed tricky little lookup/term bug