Decided to use casts to deal with strange build issue: in some places ints are used for window size vars and doubles are used in others. Problems will occur once window sizes exceed available precision.