Fix failure when mode attribute is accidentally omitted
Merge pull request #3 from rragan/master

Fix failure when mode attribute is accidentally omitted