Fix broken test in TeamCity and AppVeyor