Add some error_exit statements to help debugging.