small fixed and tests in main