Added some ack handling on both sides, various other small changes/cleanup