Port last changes to moto branch