Rework patches and update for svn r1361