Keep in sync with other implementation.