Fix history not saving, handle empty rc folders