fix for issue #44: Hang when going to preferences.

Fixed a bad for loop.
Merge pull request #45 from calband/fix_issue_44

fix for issue #44: Hang when going to preferences.