Fix breaking test and add additional condition to test.