Forward port misc fixes in stable builds.