gh-1816 PR with small fixes

To allow the merge faster as PLC is not avail, I'm making a new PR with a few fixes for gh-1816.