Updated register token

Fixes #353
Fixes #341
Merge remote-tracking branch 'upstream/master' into master+js-fix