Undefined index: text

Giving this a play today and when testing the text output I got ```Undefined index: text```.

Had a look at the full response and noticed that ```text``` was actually ```txt```. I have updated the code and hopefully the relevant test to fix this.