fixed some syscall bugs