You were on the right track. The fix is a bit different and set the tileID to 0 because we cannot assume the first tile in the tileset is empty.
The issue if caused by some tiles that are not set in your tilemap. With the fix, it should work and display the tilemap properly, however you might have a problem if you create collision with your tilemap because all the tiles are are not set will be solid with the current SDK