Also, if you want to figure out where / how the url is being corrupted you can try changing any of the $WA_redirectURL or $GoToPage variables to the location you want to go to.
Start with the first one (line 306), fill out the form and submit it (only that first insert/email will complete.) Do you get where you think you should get to? If so, then remove the URL from that one and move on to the next one.
Once you figure out which one is not working properly you can try to figure out where it is being corrupted between the last working header redirect and the current one using die($variable); in various places to see at which point it gets corrupted. You can move the die() command, save the file and simply hit refresh on your testing server to reload the filled form and try the die in the new place.
Make sense?