Clean up some of our metadata handling.