Fixed the undefined period problem.