Fix various tests to work correctly with certain configurations