Lambda matrix calculation fix