Defensive programming additions