BUG FIX: mkdirs() could return "object 'res' not found" error.