Fix more stupid and slow code