Fixed close bugs and send bugs and data seems to arrive correctly. Now
need to see a way to remove unused packages