Fixed issue #42 and tweaked tests