Fix some bugs in the profiles dialog model.

1) When adding profile selection is cleared.
2) When deleting the selected profile selection is cleared.
Merge pull request #145 from greboid/master

Fix a couple of bugs in the profiles model.