Fix occasional segfaults when prompting for password. Fixes #83
Merge branch 'develop' into develop.macosx