Fix critical quality flaws