Update last changes with Bernardo code.