Fixed exception handling in Scanner.ping