Fix guard to avoid passing undefined as Client pid