rebased 1.8.7-head patches
added patches for 1.8.7-p374