Added test and fixed issue #8.