Initialize some variables to prevent notices

Some variables weren't always set, and generated notices.