Minor fixes and improvements to the new metadata system