Syscall bug fixes