Fixed bugs in client and prolog prog.