Added function to normalize specification keys and values