Fixed checking if attributes exist for setting default values.