We prove that the Witten–Reshetikhin–Turaev (WRT) SO(3) invariant of an arbitrary 3-manifold M is always an algebraic integer. Moreover, we give a rational surgery formula for the unified invariant dominating WRT SO(3) invariants of rational homology 3-spheres at roots of unity of order co-prime with the torsion. As an application, we compute the unified invariant for Seifert fibered spaces and for Dehn surgeries on twist knots. We show that this invariant separates Seifert fibered integral homology spaces and can be used to detect the unknot.