fix problems found in testing