Fix warnings and generics and add -Xlint:all to compilation