fix infinite loop when handling syscalls.
Merge pull request #3 from baris/master

Fix inf. loop when handling syscalls