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.
Merge remote-tracking branch 'upstream/master' into features_loop_recorder