In the method distribute() from Fact.java is the line_id for factLine with 0 defined and later not updated, so the posting has always Line_ID=null in the destination-accounting-record.
Queries like taxcorrection by discount or write off are searching for accounting facts with line_id = null and get wrong information.