Move these down about 15 lines, and add the appropriate `= NULL;` in each of the conditionals.