resources: Strip '$' and 'mw' from file closures