source: Correct all issues in BP algorithm