Prevent duplicate logins
Fix build and a few includes