Fix for python3 support and log all errors