add module test for Lattice and corrent a few errors.