I will look into it, thanks for the detailed report.
Edit: if you want quick fix: change if action.tags.find('sub'): to if action.tags.find('sub') >= 0:
same with ('dom')
That did it, thanks.