Patch 1.
* Implemented some logging here and there.
* Removed trailing white-space.