Fix uleb128 and add proper length header at start