Defensive programming finalized