Improved selection handling. Added deselect delegate callback.