Fix evaluation order, avoid repeated lookups

Authored by nienhueser on Jan 28 2017, 2:24 PM.