added -wall and fixed warnings