Fix bug in test method