Fixed bug in LMA