Fix dictionary lookup function.