A few more error handling tweaks