Fix two bugs related to out-of-date client-side state