Fixed some issues from the CppCheck report.