MultiPatch taken from trunk

THis patxh shodul be a series of cherry picks but it wall went wrong.
Do this patch again from original patches.