Selection and unselection of entities

Fix for issue 95 .