Few more fixups for error handling and stuff.