improve memory management, attempt client side resume implementation, other minor fixes