Fixed some nit stuff like checking for undefinedness