The confinement of excitons in CdTe/ZnMgTe quantum dots is shown to be significantly enhanced by the insertion of thin MgTe barrier layers next to the CdTe quantum dot layer. This has the effect to rise up the wetting layer states. As a consequence, excitons remain in the quantum dots up to higher temperatures.