Added isset check to things that may not be set.