Partial fix for #1824: missing import of os