sped up calculation of normalization constants; added some error checking to --share_embeddings