Fix model optimization bug and data copying to vertex buffer bug.