More checks and some logging