Fix for race condition and directory retrieval bug.
Merge pull request #175 from WhisperSystems/registration_fixes

Fix for race condition and directory retrieval bug. LGTM.