Closes #253.

I simplified the implementation of this class a bit, and extended the unit tests to include a case that was causing problems before.
Code syntax
Fixed unused parameter
Merge pull request #254 from standage/master

Closes #253.