Tweaks after regressions from last commit

A few adjustments to
commit a595d3cc0fd0d6bdd16a827073e7a64bb7de87c6
to make code work.