Add checks for undefined variables.