miscellaneous fixes for problems found by @aghosn

Thank you, Adrien!