Fix problem with the WaitInterval and buflen