simplify metadata conversion and fixes gcc-2.95 at the same time