Tidy up type signatures, use a better type for optional file paths.