Upgrade client to 2.0.0 and update affected code.
Style.
Add a null check.
Merge pull request #29 from racker/upgrade_to_2.0.0_and_improve_stuff

Upgrade to 2.0.0 and improve stuff