Fixed a bug when a lattice has more than 1 lookup field.