Fix #8 : handle errors when lapmat is full of NaN