Fix for wauth2 (issue #342)