Changed all ioctl errors to translate the error codes