Remove unncessary include
Fixed reading (better error handling, cope with incomplete reads)