Tweak based on flawfinder & cppcheck
Tweaks based on cppcheck & flawfinder, adjust -g to -ggdb3 option