Fix bug with caption generation within table instead of level 1 header