Fix metadata parsing