More fixes and formatting. (#21)
Fix getCount issue, usually does not crash anymore.
Fix selected item bugs.