Small mods for improved error handling.