Fix timeout setting in read