Reasoning in Transformers -- Mitigating Spurious Correlations and Reasoning Shortcuts