fixed filesystem code broken in Windows (someone has to check it on Mac)