Error handling improvements
Fixes