Added -Wall option and solved some related warnings