Fix invalid session in XAPI connection (should fix #20).