Fix compilation error
Clean up a bunch of warnings