some php client fixes -- work in progress