fix some side effects with tests