Added missing testmode code