Remove two useless undef's and make a useful function global.