Fix python3 compatibility issues with doc fix