Even more logic fixes.