Fix logL.Mat. Add mapBMatNames. Fix sample.res problem