Fix ruby 1.8.7 spec failures

ruby 1.8.7 does not allow trailing commas in a list. Ruby 1.8.7 does
also not return the keys of a hash in a deterministic order.