key_to_filename only passes if key is valid word

Fixes #1  (thanks @grimnight)