Issue #2204273 by DanChadwick: Backport of incorrect negative number analysis