Bugfix - Downloaded files were of 0 bytes. 

This fix was borrowed from https://github.com/n1k0/casperjs/issues/73