Put the unsigned coercion back in.

Woops.
Use unsigned int instead of int.

nread should never be 0.