Fixing lots of warnings