Misc fixes and result checks
Merge pull request #892 from hardening/hardening4

Misc fixes and result checks