Fixed the bug. Test file also updated.