Fix optional models check