Fix #183 - pif doesn't stop at function's end