don't try to work with an invalid key

Hi, great work on this project!  I just started looking into BIP32 wallets and wasn't sure if any services existed to check the balance of an HD wallet so I was super happy to find your page or I would have probably ended up trying to write it myself.