Bug fixes to cutout.py