Fix frameID checks on last frame instead of current one.