Minor changes to thin.py for better user-friendly thinning.