Fixed: read() error was counted as -1 bytes received