added boost unit test, fixed bugs