Added check to ensure that ids contains some elements before trying to access them.

Fixes #311
Feature #81.  Added remove account settings