tighten code & fix argument error

removed 7 lines of code for a simpler method of making work directories.

Found that $flags wasn't being set any more so I removed it and replaced
it's use by calling a join against @cache_rec_types