WIP: changes behavior so that an array with one element is returned as a string - also checks for class in spec