fix some errors in graph cut