Moved free to avoid a double free error when the user supplies an
invalid operator.