Upgraded to Ratchet 2.0.2

Also some code tweaks