client.c fixes and greetings implementation (for real)