Convert and complete unit test and fix bug in page