fixed missing import os, sys
(#389)