Error handling tweaks