fix markdown errors and bugs in thor script