Minor improvements and fixes.

* Added tests.
* Fixed logger message, when objects can't be stringify.