Minor fixes in JS client and AuthHandler