corrected a lot of warnings