Update RELEASE_NOTES.
Update version to 2.2
Fix compiler warnings.
Merge branch 'master' into 2.2
Fix file indentation.
Put the release notes in the NEWS file.