Merge b3736693158107e6fd93d3e025a547a5590265de, fixes #1137 for branches/1.0