Add back fix for cross compile tests

This change was accidentally included in the reverted commit.