Fix some problems in lightmeter.c