Revert "Revert "Couple of small fixes""

This reverts commit 3afe1de2e8de9e3367ce38d16e1acb92c40b30ac.