Misc fixes

Hello,
Some small fixes for your useful scripts, thanks!
Best,
Baptiste