Try changing
my $total = $tags->{total};
to
my $total = (ref $tags->{total} ? ${$tags->{total}} : $tags->{total});
Edit: Taking another look this shouldn't be affecting the low number - I think it is more likely to be a change to the 'title' tag.
my $total = $tags->{total};
to
my $total = (ref $tags->{total} ? ${$tags->{total}} : $tags->{total});
Edit: Taking another look this shouldn't be affecting the low number - I think it is more likely to be a change to the 'title' tag.