Fix off-by-one errors in frame count.