Add python3 compatibility to some examples