Several improvements

Thank you for the tool. Here are several improvements containing:

* Search query URL string encoding
* Country code option implementation
* Fixes for crash and memory leak