DMA tidyup

Fixes issue #89 as well and also removes some redundant code.