cosmetics and scan-build errors fixed