Sync with 3.1.3 tag from SVN

No actual code changes, just all whitespace and line endings