Fix feature detection error undefined method pointer on nil:NilClass.