Various mods for code hardening per CLANG error report

bug 403
Tweak code to eliminate CLANG false positive

bug 403