Add a function to handle defaulting and checking.