Fix some minor issues found by scan-build

Description

A run of scan-build aka clang analyzer found some trivial errors.
The attached patch fixes many of them. Tests run fine.

Assignee

Steven R. Loomis

Reporter

TracBot

Components

Labels

None

Reviewer

None

Priority

minor

Time Needed

None

Fix versions

Configure