Fixed serial command echo issues and made it close down gracefully. Seems to work now