fix a number of small errors found in first testing