fix a (so-far harmless) bug in location reporting
mark missing close-file markers
improve laziness