Lmert.re2

Merging various lmert changes, and a few minor changes/fixes to the compilation script.