Some improvements with memory allocation and client control