Fixes a bug where framesToFrameRange could leave off the last frame.