Fixing bug 1240, false alarms of credit exceeded.
Merged from main repo
Merge pull request #459 from einhverfr/1.3

Fixing bug 1240, false alarms of credit exceeded.