some logging and fixes