Altered the generate_name method to use uniqid when an internalKey is
not provided.