Minor bug fixes and add DMA some code