fix some bugs

Now we can handle some error source and sink, and return a warning.