Added delete function and other fixes

Also made the client_name add automatically for consistency