Fix #482 - Bring across client code
Fix #463 - Bring across client changes