Fixes for #5356

This PR fix various inconsistencies introduced by #5356 

Also there was another issue introduced at merge time already fixed and merged in d435a7e6e3c48e7ebebae1b44e3844524e34547e