Bug fixes as a result of post Python3 testing