Fixed bug with metadata length not being set when outputting HIBs