Fixed an issue with users not being logged in with the correct user ID immediately after registering.
Commiting changes for merge.