clean ups and fix some tests