Handle when devices is an array.

Convert to a hash for proper handling.