Fix scoping issues that were affecting logging in and registering current_user