Add some logging and fixup a few checks