Cleaning up warnings. Includes port of CollectionsState.