Fix for off-by-one-frame error.