Fix for defects CID 51684 and 51666
Fix for defects CID 51686, 51685, 51687 and 51667