Fix #6: patch sys after thread

from PR #232