Changed bytesLeft to long, per #10