lots of warnings fixed