Fixed transferProgressCallback.

Rebased to include NULL check.