Fix assignment issue with client causing null pointer

And make some methods static to fix warnings caused by the change