Changes to 8.5 registration flow.

Fixes #498 and also fixes #499.