Fixes send close issue + some clean up