Fix backport bug

Fix a couple of bugs pointed by @jferlan