Issue #2204273 by DanChadwick: Backported incorrect negative number analysis