Added warning related compilation flags and fixed related errors.