more logging and small fixes.