case 3654 - Some logic fixes and improvements.