Fixed a lot of warnings