Fixed regtoken bug, issue #22