Fixed bug on setPrimaryCollection.