Fix bug with payload checking. Fix compatibility tests

I had a bug in the compatibility test which was hidden by a bug in the client code for the authentication method.