Fixed lots of warnings