Fixed a bug in periodic unit test