Core/Misc: Fixed some more issues found by code analysis tools.