continuing test of copyUntilFull()
this pointer casting was cause of segmentation fault
additional fixes after my testing of copyUntilFull()