Another tip, if the images still aren't aligning well. In the "Fast Preview Window" (press Ctrl + Shift + P) go to the Assistant tab. The top right of the screen will show something like:
"Images are connected by [some #] of control points", as well as the mean error and max error.
The smaller those errors are, the better, and ideally we want a mean error of less than 1. Most likely they are not less than 1. If they're very big, here's what you can try:
In the main Hugin window go back to the "Photos" tab. Click through the image list and choose one you would like to act as the center of your panorama (it doesn't really matter which you choose). Right click that image in the list, and select "Anchor this image for position".
Then, at the bottom under "Optimize", select "Geometric > Everything" and press Calculate. Once this is done, a window will pop up showing the results, again with the average and maximum control point distances. You may also notice that it adjusted what it thinks the best focal length is. Hopefully this will have resulted in a better looking stitching in the preview window, and reduced the error.
If the mean error is still very large, then in the preview window check the layout tab.
The lines represent connections between the images by control points, and the color of the line represents the maximum errors on the control points between them (green is good, red is very bad). You can click on a line to pull up the list of control points, and delete the bad ones. As you do, visually check to see if they really do make sense or not (clicking a control point pulls up a very zoomed and enhanced image to show exactly where those points are). Alternatively, you can go back to the main Hugin Window and under "View" open the Control Points list (or press F3). You can sort them all by distance, and delete the big ones. Then repeat the optimization.
You should also look through the layout again and see if there are nearby, unconnected images. If so, try adding a few control points manually. I often find that Hugin's automatic control point algorithm has a hard time with stars on the sky, but it is often easy to find bright, easily identifiable stars and asterisms which make for great manual control points.
So in summary, the better the control points are, the better the result will be. Usually the automatic control point finder does a good enough job to find how the images are connected, but some of the points may be very bad and ruin the stitching. Remove the bad ones and if necessary add more good ones manually. The other part of the problem may be the FOV or focal length. I've noticed that using the FOV that Space Engine shows is not necessarily the right FOV for Hugin. Try running the optimizer.
Finally, if the horizon looks wavy, or upside-down, that's real easy to fix. In the preview window, go to the "move/drag" tab and click "level horizon". You can also click and drag the image, or rotate the small sphere on the left.