Tests for the Defender and improved Defender code