fix calculating positions of tokens
fix incorrect building of source code