Fixed the pubkey validation and the server port issue. Resolves #18. Improves upon #5