Merge changes from trunk. Check auth and recompute session key when out of synch...