Fixed a case when public key contained null bytes