Unlike tuples, sets do not need trailing comma when there is only one item.
This adds tests for some locations in the code where a memory allocation should raise an exception.