better logging; fixed tests