Minor logic fixes, nothing should change.