Error logging improvements
Merged in main