Improved logging in tests