Fixed some notices and a setting vs variable miss

Fixed some notices and a setting vs variable miss