fix a bug where a signature without a publickey could cause panic + test