Fixed some login bugs with new structure. Handshake ok now.