Fixed static analysis warnings and increased code coverage (slightly).