Fix metadata not saving/loading correctly