Rework patches and update for svn r1390