Logic fixes.