Fix for bad math in scenario window

Fixes #8934 (I hope so).