Merge pull request #14 from armed/master

Added failing test and fix for #7.