Some code cleanup, while working on Library concurency refactoring.

Thanks to Daniel for preparing this patch!
Merge pull request #89 from troyane/CodeCleanup

Some code cleanup, while working on Library concurency refactoring.