Script: fixes pubKeyInput and adds a test