Fix lmert compilation

- lmert was not compiling with g++ 4.2
- also re-indent some code appropriately.