Fixed code to use new metadata with arenas