Prevent invalid path errors.