Refactoring: tests refactored, few bugs fixed in JobDispatcher.