a little more logging

and some bug fixes