Fix timeout + minor fixes.
Merge pull request #4257 from HassenRiahi/MinorFixes

Fix timeout + minor fixes.