Some ForeignCollections and Test fixes

We corrected some ForeignCollection and Test issues which we found during our development.