Fix to edge cases of ATCompSquare.