Reintegrate last changes from bear