added unit tests for the 'titled' input tag substitution, and they helped me
uncover a bug in my changes, which is also fixed by this commit.