fixed python logging and other small python improvements