fixed bug in pointers arithmetic, wrong condition in test_client (on behalf of Usama Chaudhry)