Quick bugfix to the metadata code