Fixing numerous warnings and a failed compilation in tests.