Added flush to stdout prints in thin.py