Updated for more consistency with machine token code.