Lagmeter fixes

Should fix #758 and #749.