Updated some error handling voodoo.