Client activity timeout fixes

This fixes a few issues relating to da0a827e2a85d9388123b50ae4cda93d2f0c32b7

Things now seem to be working as expected in the test app.