Fix sample scripts for Py3