Fix build error
Add more patches and apply script