Fixed Undefined variable notices