Properly handle undefined scratch directory