In the presence of background Neveu-Schwarz flux, the description of the Ramond-Ramond fields of type IIB string theory using twisted K-theory is not compatible with S-duality. We argue that other possible variants of twisted K-theory would still not resolve this issue. We propose instead a connection of S-duality with elliptic cohomology, and a possible T-duality relation of this to a previous proposal for IIA theory, and higher-dimensional limits. In the process, we obtain some other results which may be interesting on their own. In particular, we prove a conjecture of Witten that the 11-dimensional spin cobordism group vanishes on K(Z, 6), which eliminates a potential new θ-angle in type IIB string theory.