some cleanup/fixes for the syscall code