Second round of merging Sergeev changes.