Changed file descriptor handling