${x,,} does not work on Darwin bash (only ver 4+). Fix with more generic solution.