Negative dividend handling + tests (#453)