Moved error message handling to die() function in misc.[c,h]