Attempt to resolve custom downloads stack smashing issues.  Move bit arrays off stack onto heap.
Attempt to resolve update stack smashing issues.  Move bit arrays off stack onto heap.
Fix uninitialised memory and other buffer errors shown by valgrind.
Fix use of initialised memory shown by valgrind.
Fix use of initialised memory shown by valgrind.
Fix use of initialised memory shown by valgrind.