Specs for set and elements, some bug fixes