fixed a lot of gcc warnings