Merge for the last bugfixes of 3.1.x