fixed minor signal and ioctl bugs