Tests modified and logging added