Fix frame out of range error for -O2 release build (may or may not fix on other syste...