More fixes in the Python sample backend