More logging when connecting to the server.
Fix import and usage of datetime.timedelta.