Fix all sorts of warnings and stuff.