Add some auto generate code and fix