bug fixes in metadata module