Added change to comply with changes in the comparison of optionals which now needs to explicitly compare against nil.