Shortened some if statements

Shorted  if(object != nil) to if (object).