Fix bugs in python modular examples introduced by 03c02571f1