Fix an issue on calculating actions length.