Fix reading from remote on some *nixes