Fix a factory that was generating duplicate plan IDs sometimes