Somehow fails unit testing