Fix for python3 support, close sessions during test and log all errors