Fix bug in unittest