Making code more defensive.