Type soundness fixed