Fixes and extra logging