Fixing length of remaining data to be read.
Changed Request wait loop so, that it only timeouts when we actually timeout on the semaphore.