Boil your pasta less than al dente to prevent the pasta from becoming mushy. The pasta will continue to cook while in the oven, so slightly undercooked pasta will help maintain a good shape.