Improved the way public keys are added (Fixed #66).