Resolves exception during edit when restoring focus

Resolves issue #17 where app dies when if editing a note, then switching to another app, and then switching back.