Multiple changes

- Fixed several bugs in collection and entity key sets.
- Added a new example showing the usage of collection.