added handling for empty base paths. File does not support joining nils