Fix rebuild patches to cleanup directory before it rebuilds.