replaced unit test with property based test for better coverage.
fix two small bugs
improve logging.