Fix $PYTHON check
Implement SF_DEBUG and SF_FLAGS