Adding clientLib, fixing a few bugs..