The 17-40 is a great lens and f/8 would give plenty of DOF at the distances you're shooting. Take a look at these. They were all shot in RAW, Av mode at f/8, and under exposed about 2/3rds to get the sky color. The only PP was with levels & shadows to bring the foreground back up, and some sharpening.
Make sure you put the hood on and keep trying!

