Improve error handling
Merge remote-tracking branch 'origin' into release/2.6.1