fixed minor issues and tests