Merging development into master

Various fixes remained pending since June.

@traversaro  If you want to check

I'll probably add a `if(!ret) break;` for the sake of readability.