Code review

Hi,

just joined the project and while compiling i noticed couple of important things that need to be brought into light to avoid future issues. The stuff should be taken into account as they can save us from potential threats and code instabilites.