fix bug with code that supports more than 65535 vertices