small bug fix, and added a test for primary functionality... ... ...