Fixed up metadata extraction