Fixes for some undefined variable situations.