client.c fixes and greetings implementation